//
//  UIImageView+Extension.m
//
//  Created by Detailscool on 16/2/28.
//  Copyright © 2016年 Detailscool. All rights reserved.
//

#import "UIImageView+Extension.h"
#import "UIImage+ClipImage.h"
#import <UIImageView+WebCache.h>

@implementation UIImageView (Extension)

- (void)setHeaderIconWithURL:(NSString*) url {
    
    UIImage * placeHolder = [[UIImage imageNamed:@"defaultUserIcon"]clipImage];
    
    [self sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:placeHolder options:SDWebImageRetryFailed | SDWebImageLowPriority completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        self.image = image?[image clipImage]:placeHolder;
    }];
}

@end
